Rails.application.routes.draw do
  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html


  post "/admin/transactions/:id/refund" => 'admin/transactions#refund', as: :admin_transaction_refund
  post "/admin/transactions/export" => "admin/transactions#export", as: :admin_transaction_export
  post "/admin/refund_applications/:id/agree" => 'admin/refund_applications#agree', as: :admin_agree_refund
  post "/admin/refund_applications/:id/refuse" => 'admin/refund_applications#refuse', as: :admin_refuse_refund

  post "/admin/pay_callbacks/:id/refund" => 'admin/pay_callbacks#refund', as: :admin_pay_callback_refund

  namespace :admin do
    post 'overviews/data' => 'overviews#data'
    post 'appointed_overviews/data' => 'appointed_overviews#data'
    post 're_purchase_overviews/data' => 're_purchase_overviews#data'
    post 'conversions/data' => 'conversions#data'
    post 'company_overviews/data' => 'company_overviews#data'

    post 'wallet_trans_logs' => 'wallets#create_log', as: :wallet_trans_logs

    post 'companies/:company_id/wallets/:id/publish' => 'wallets#publish'
    post 'companies/:company_id/wallets/:id/pull' => 'wallets#pull'
    post 'companies/:company_id/wallets/:id/online' => 'wallets#online'
    post 'companies/:company_id/wallets/:id/offline' => 'wallets#offline'

    delete 'companies/:company_id/wallets/:id/:store_id' => 'wallets#remove'

    post 'wallets/report' => 'wallets#report'
    post 'payrolls/recalculate' => 'payrolls#recalculate'
    post 'stores_reports/calculate' => 'stores_reports#calculate'
    post 'orders/report' => 'orders#report'
    post 'appointments/report' => 'appointments#report'
  end
end
